package com.taijia.chapter8;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

public class Transform2 {
	public static void main(String[] args) {
		InputStreamReader isr = null;
		BufferedReader br = null;
		try {
			// System.in 是阻塞式的 / 同步式的
			isr = new InputStreamReader(new FileInputStream("E:/myeclipse2014/Workspaces/2014/msb_basic/src/com/taijia/chapter8/Transform1.txt"));
			br = new BufferedReader(isr);
			String str;
			while ((str=br.readLine()) != null) {
				System.out.println(str);
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if(isr != null) {
					isr.close();
				}
				if(br != null) {
					br.close();
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
